package cn.ltgodm.template.user.service;

import cn.ltgodm.template.common.domain.TreeSelect;
import cn.ltgodm.template.common.domain.entity.Menu;
import cn.ltgodm.template.user.domain.param.MenuParam;
import cn.ltgodm.template.user.domain.param.MenuQueryParam;
import cn.ltgodm.template.common.domain.vo.MenuVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
* @author wenpeng
* @description 针对表【lt_menu(菜单权限表)】的数据库操作Service
* @createDate 2024-03-18 20:43:33
*/
public interface MenuService extends IService<Menu> {

    Set<String> selectMenuPermsByRoleId(Long roleId);

    Collection<String> selectMenuPermsByUserId(Long userId);

    IPage<MenuVO> selectMenuList(MenuQueryParam menuQueryParam);

    MenuVO selectMenuById(Long menuId);

    List<TreeSelect> buildMenuTree(List<MenuVO> menuList);

    List<TreeSelect> selectMenuTree(MenuQueryParam menuQueryParam);


    List<Long> selectMenuListByRoleId(Long roleId);

    boolean checkMenuNameUnique(MenuParam menuParam);

    int insertMenu(MenuParam menuParam);

    int updateMenu(MenuParam menuParam);

    boolean hasChildByMenuId(Long menuId);

    boolean checkMenuExistRole(Long menuId);

    int deleteMenuById(Long menuId);
}
